< previous page page_880 next page >

Page 880
Now add the following code to the Form_Load and Form_Unload events.
Private Sub MDIForm_Load()
    LoadCmdBtns ' set up buttons
End Sub

Private Sub MDIForm_Resize()
    LoadCmdBtns
    lblProgress.Width = Me.ScaleWidth * 0.98
End Sub
Next, add the code from Listing A.9 to the cmdBtns_Click event. This handles all the command button selections.
Type.gifListing A.9. Adding code to the cmdBtn_Click event.
Private Sub cmdBtn_Click(Index As Integer)
    '
    Select Case Index
        Case Is = 0
            mnuFileNew_Click
        Case Is = 1
            mnuFileEdit_Click
        Case Is = 2
            mnuFileClose_Click
        Case Is = 3
            mnuFileAuto_Click
        Case Is = 4
            mnuFileRun_Click
        Case Is = 5
            mnuFileExit_Click
    End Select
    '
End Sub
Next, add the code for the File | Close menu selection.
Private Sub mnuFileClose_Click()
    '
    On Error Resume Next
    SQLFileClose
    InitApp
    '
End Sub
Add code behind the Help menu option that shows off the SQLVBAbout form. To open the code window for the About menu option, select Help | About. When the code window pops up, insert the following code:
Private Sub mnuHelpAbout_Click()
    frmAbout.Show vbModal
End Sub

 
< previous page page_880 next page >

If you like this book, buy it!